﻿using JxcLite.Helpers;
using Microsoft.Extensions.DependencyInjection;

namespace JxcLite;

public static class AppCore
{
    public static void AddJxcLiteCore(this IServiceCollection services)
    {
        services.AddKnownAdminCore(option =>
        {
            //option.ProductId = "Test";
            //option.CheckSystem = info => Result.Error("无效密钥，请重新授权！");
            option.AddModules(ModuleHelper.AddAppModules);
            //option.AddAssembly(assembly);
        });
        services.AddKnownCells();

        // 注入服务
        services.AddScoped<IHomeService, HomeService>();
        services.AddScoped<IBaseDataService, BaseDataService>();
        services.AddScoped<IBillService, BillService>();
        services.AddScoped<IInventoryService, InventoryService>();
        services.AddScoped<IFinanceService, FinanceService>();
        services.AddScoped<IReportService, ReportService>();
    }
}